package com.km.service.impl;

import com.km.dao.DingdingMsgDao;
import com.km.entity.DingdingMsgEntity;
import com.km.service.DingdingMsgService;
import com.km.service.DingdingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service("dingdingMsgService")
public class DingdingMsgServiceImpl implements DingdingMsgService {
    @Autowired
    private DingdingMsgDao dingdingMsgDao;

    @Resource
    private DingdingService dingdingService;

    @Override
    public DingdingMsgEntity queryObject(Long id) {
        return dingdingMsgDao.queryObject(id);
    }

    @Override
    public List<DingdingMsgEntity> queryList(Map<String, Object> map) {
        return dingdingMsgDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return dingdingMsgDao.queryTotal(map);
    }

    @Override
    public void save(DingdingMsgEntity dingdingMsg) {
        dingdingMsgDao.save(dingdingMsg);
        dingdingService.sendTextMsg(dingdingMsg);
    }

    @Override
    public void update(DingdingMsgEntity dingdingMsg) {
        dingdingMsgDao.update(dingdingMsg);
    }

    @Override
    public void delete(Long id) {
        dingdingMsgDao.delete(id);
    }

    @Override
    public void deleteBatch(Long[] ids) {
        dingdingMsgDao.deleteBatch(ids);
    }

}
